package com.ruoyi.coal.modules.coalpile.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.coal.modules.coalpile.domain.CoalYardInfoEntity;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CoalYardInfoDao extends BaseMapper<CoalYardInfoEntity> {
    @Select({"SELECT id FROM cp_coal_yard_info WHERE del =1 AND NAME<>'导入料堆'"})
    List<Integer> getCoalYardId();

    @Select({"SELECT name FROM cp_coal_yard_info WHERE del =1 AND NAME<>'导入料堆'"})
    List<String> getCoalYardName();

    @Select({"<script>", "SELECT name FROM cp_coal_yard_info WHERE del = 1 AND id IN ", "<foreach item='id' index='index' collection='array' open='(' separator=',' close=')'>", "#{id}", "</foreach>", "</script>"})
    List<String> getCoalYardNameByIds(@Param("array") List<Integer> paramList);
}
